{% extends "base.html" %}
{% load staticfiles %}
{% block title %}
转账 -- -- 软件代理后台
{% endblock %}
{% block wrapper %}
        <!-- Page wrapper  -->
        <div class="page-wrapper">
            <!-- Bread crumb -->
            <div class="row page-titles">
                <div class="col-md-5 align-self-center">
                    <h3 class="text-primary">转账汇款</h3> </div>
                <div class="col-md-7 align-self-center">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="{% url "index" %}">主页</a></li>
                        <li class="breadcrumb-item active">转账汇款</li>
                    </ol>
                </div>
            </div>
            <!-- End Bread crumb -->
                        <div class="card">
                            <!-- Nav tabs -->
                            <ul class="nav nav-tabs profile-tab" role="tablist">
                                <li class="nav-item"> <a class="nav-link active" data-toggle="tab" href="#home" role="tab">转账汇款</a> </li>
                            </ul>
                            <!-- Tab panes -->
                            <div class="tab-content">
                                <div class="tab-pane active" id="home" role="tabpanel">
                                    <div class="card-body">
                                        <form class="form-horizontal form-material" action="{% url "transfer" %}" method="post">
                                            {% csrf_token %}
                                            {% if warn %}
                                            <div class="form-group">
                                            <div class="alert alert-danger alert-dismissible fade show col-md-12">
                                                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
                                                <strong>警告！</strong> {{ warn }}
                                            </div>
                                            </div>
                                            {% endif %}
                                            {% if success %}
                                            <div class="form-group">
                                            <div class="alert alert-primary alert-dismissible fade show col-md-12">
                                                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
                                                <strong>警告！</strong> {{ success }}
                                            </div>
                                            </div>
                                            {% endif %}
                                            <div class="form-group">
                                                <br>
                                                <label class="col-md-12">金额</label>
                                                <div class="col-md-12">
                                                    <input type="text" placeholder="请输入需要转账的金额（余额为：{{ balance }}）" class="form-control form-control-line" name="money" >
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-md-12">收款账户（只允许对下级代理账户转账）</label>
                                                <div class="col-md-12">
                                                <select class="form-control" name="account">
                                                    {% if down_account_list %}
                                                        {% for i in down_account_list %}
                                                        <option value="{{ i.user.id }}">用户：{{ i.user.username }}</option>
                                                        {% endfor %}
                                                    {% else %}
                                                        <option value="0">你暂无下级账户，无法转账</option>
                                                    {% endif %}
                                                </select>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label for="example-email" class="col-md-12">提示</label>
                                                <div class="col-md-12">
                                                    <input type="text" placeholder="转账后无法追回！请核实账号！" class="form-control form-control-line" disabled="disabled" >
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-sm-12">
                                                    <button class="btn btn-success">确认转账</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                                <!--second tab-->
                            </div>
                        </div>
                    </div>
                    <!-- Column -->
                </div>

                <!-- End PAge Content -->
            </div>
            <!-- End Container fluid  -->

{% endblock wrapper %}

    <!-- End Wrapper -->
{% block js_more %}
      <script>
          $(function(){
            $("html").niceScroll({
                cursorcolor:"#16385d",
                cursorwidth:"5px",
                background:"#fff",
                cursorborder:"1px solid #5c4ac7",
                cursorborderradius:0
                });  // a world f
          });
      </script>
{% endblock js_more %}